# coding=utf-8
# 全世界最帅的帅哥
from enum import Enum


class SubjectTypeEnum(Enum):
    RADIO = (1, "单选")
    MULTIPLE = (2, "多选")
    JUDGE = (3, "判断")
    BRIEF = (4, "简答")

    @property
    def code(self):
        return self.value[0]

    @property
    def description(self):
        return self.value[1]

    @staticmethod
    def get_by_code(code):
        for member in SubjectTypeEnum:
            if member.code == code:
                return member
        return None

